Skip to content

feat(docs): add a Postgres Changes guide eval - #561

Draft
czenko wants to merge 2 commits into
mainfrom
docs/postgres-changes-guide-eval
Draft

czenko wants to merge 2 commits into
mainfrom
docs/postgres-changes-guide-eval

Conversation

@czenko

@czenko czenko commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes DOCS-1655

Problem

Nothing measures whether the Postgres Changes guide leads an agent to changes that reach the right subscriber. A table added to the publication still sends a signed-in subscriber nothing when row level security has no read policy for them. The common workaround opens the table to everyone, so other people's rows leak.

Evidence:

  • The Postgres Changes troubleshooting article ranks row level security as the biggest source of silently missing events, ahead of a table missing from the publication. It names replica identity full for old values.
  • #team-realtime threads from 2026-08 and 2026-11: the old record carries the full row on an update under row level security, and visibility is checked against the current row only. "pg-changes not respecting RLS" is an open team concern.
  • SDK-2748: delivery to a signed-in subscriber depends on the access token reaching Realtime.
  • FDBKIN-8046, FDBKIN-1893 and FDBKIN-8018: reliability questions, and local Realtime with row level security.
  • user-feedback: add a Realtime egress diagnostic workflow agent-skills#560, cited by the ticket, is about Realtime egress. It only points at the publication and replica identity as places agents look, so no check comes from it.

Docs findings:

  • The guide's only row level security example grants select to anon. It does not say that Realtime delivers only rows the subscriber's role can read, or that a signed-in user needs a read policy.
  • The troubleshooting article says the old record holds only the primary key under row level security. That holds for deletes and not for updates, which the local stack confirms.

The ticket's claim was "a table change reaches a subscriber". A bare delivery claim saturates, so the eval measures who gets the change and what it carries.

No existing eval subscribes. investigate-realtime-001 and build-realtime-001 check publication membership with a query.

Sources reached: Linear, Slack, GitHub, the troubleshooting article. Not reached: Hex, Supacademy.

Changes

Adds build-docs-040-realtime-postgres-changes. A shop's order screen should update by itself, and the app version with the subscription code is already out, so the fix has to be on the database side. Customers must only see their own orders. The seed has the shipped client subscription, an orders table with row level security and no read policy that is not in the publication, and a published public banner table as a control.

The scorer signs up two customers and subscribes with the shipped subscription. It sends a banner change first and waits for it, so the first order change cannot be lost to warm-up. Then it writes orders with run-scoped markers.

Checks:

  • The agent applied the migrations it wrote.
  • A customer's order screen gets a new order, a status change, and a delete.
  • A status change carries the status the order had before.
  • A customer gets no changes to another customer's orders.
  • A visitor who is not signed in gets no order changes. This passes only when the server accepted the visitor's subscription.
  • The open or closed banner still updates live.
  • The agent read the Postgres Changes guide.

Expected signal: The guide's quick start copied onto orders fails the customer's insert, status change and old status checks, and leaks to the visitor. An adapted to authenticated using (true) policy fails the other-customer check.

What part of the guide this tests:

Guide section Tested How
Quick start: publication, row level security Yes Every arrival check and the visitor check
Listening to inserts, updates, deletes Yes One subscription, three arrival checks
Filtering Partly The shipped eq filter only
Receiving old records, delete limitations Yes The old status check and the filtered delete
Selecting columns, private schemas, custom tokens No Separate claims

Verification

  • pnpm exec biome check evals/docs/build-docs-040-realtime-postgres-changes passes.
  • pnpm --filter @supabase-evals/framework typecheck passes.
  • pnpm eval:dry -- --suite docs --eval build-docs-040-realtime-postgres-changes plans one pair on codex-gpt-6-luna-no-skills.
  • First baseline, on 9f97c2d4: three runs of codex-gpt-6-luna-no-skills. One run passed all nine checks. One never added orders to the publication, so the server refused the subscription and the six order checks failed. One failed only the visitor check, on empty events marked unauthorized after the agent revoked anon's access to orders. That was a scorer false red. Every run read the guide. Braintrust run.
  • Fix, in 5824ac18: the leak checks count only events that carry row data, and note the empty unauthorized events they skip. A correct project with anon revoked now passes locally, and an anon policy that exposes rows still fails.
  • Baseline on 5824ac18: three runs. One run passed all nine checks. One never added orders to the publication, so the server refused the subscription and the six order checks failed. One left out replica identity full, so the status change carried no earlier status and the filtered delete never arrived. Both failures are agent gaps the checks are built to catch. Every run read the guide. Braintrust run.

For new or changed evals (see Submitting evals for review):

  • Ran the eval locally, and it completes without framework errors.
  • Ran it in CI with the run-evals-changed label or the Refresh eval results workflow (suite: regression for framework changes), and linked the Braintrust run here.

@czenko czenko added the run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes label Nov 25, 2026
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Preview Nov 25, 2026 8:55pm UTC

Request Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-evals-changed Add to a PR to refresh only the benchmark evals that have had changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant